
<!DOCTYPE HTML>
<html lang="zh" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>上下文切换和 security 函数 · Pine Script 用户手册中文版</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="剑客">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="6drawing.html" />
    
    
    <link rel="prev" href="4color.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="輸入並搜尋" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Introduction.html">
            
                <a href="../Introduction.html">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../quickstart/">
            
                <a href="../quickstart/">
            
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../quickstart/example.html">
            
                <a href="../quickstart/example.html">
            
                    
                    Pine Script 示例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../quickstart/studyVsStrategy.html">
            
                <a href="../quickstart/studyVsStrategy.html">
            
                    
                    “study” 与 “strategy”
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../quickstart/model.html">
            
                <a href="../quickstart/model.html">
            
                    
                    Pine Script 执行模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../quickstart/series.html">
            
                <a href="../quickstart/series.html">
            
                    
                    序列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../quickstart/understanding.html">
            
                <a href="../quickstart/understanding.html">
            
                    
                    理解 Pine Script
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../quickstart/editor.html">
            
                <a href="../quickstart/editor.html">
            
                    
                    Pine 编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../quickstart/next.html">
            
                <a href="../quickstart/next.html">
            
                    
                    下一步
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../fundamentals/">
            
                <a href="../fundamentals/">
            
                    
                    语言基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../fundamentals/1structure.html">
            
                <a href="../fundamentals/1structure.html">
            
                    
                    脚本结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../fundamentals/2version.html">
            
                <a href="../fundamentals/2version.html">
            
                    
                    版本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../fundamentals/3comment.html">
            
                <a href="../fundamentals/3comment.html">
            
                    
                    注释
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../fundamentals/4identifier.html">
            
                <a href="../fundamentals/4identifier.html">
            
                    
                    标识符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../fundamentals/5line.html">
            
                <a href="../fundamentals/5line.html">
            
                    
                    换行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../fundamentals/6type.html">
            
                <a href="../fundamentals/6type.html">
            
                    
                    类型系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../fundamentals/7operator.html">
            
                <a href="../fundamentals/7operator.html">
            
                    
                    运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../fundamentals/8function.html">
            
                <a href="../fundamentals/8function.html">
            
                    
                    函数和注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../fundamentals/9expressions.html">
            
                <a href="../fundamentals/9expressions.html">
            
                    
                    表达式、声明和语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../fundamentals/10function.html">
            
                <a href="../fundamentals/10function.html">
            
                    
                    函数声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../fundamentals/11model.html">
            
                <a href="../fundamentals/11model.html">
            
                    
                    执行模型
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                    基本功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="1alert.html">
            
                <a href="1alert.html">
            
                    
                    警报
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="2array.html">
            
                <a href="2array.html">
            
                    
                    数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="3barstate.html">
            
                <a href="3barstate.html">
            
                    
                    柱状态，内置变量 barstate.*
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="4color.html">
            
                <a href="4color.html">
            
                    
                    颜色
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.5" data-path="5context.html">
            
                <a href="5context.html">
            
                    
                    上下文切换和 security 函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="6drawing.html">
            
                <a href="6drawing.html">
            
                    
                    绘图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="7extend.html">
            
                <a href="7extend.html">
            
                    
                    延长和扩展交易数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="8reapint.html">
            
                <a href="8reapint.html">
            
                    
                    指标重绘
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="9nonstandard.html">
            
                <a href="9nonstandard.html">
            
                    
                    非标准图表类型数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="10session.html">
            
                <a href="10session.html">
            
                    
                    交易时段和时间信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="11strategies.html">
            
                <a href="11strategies.html">
            
                    
                    策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="12table.html">
            
                <a href="12table.html">
            
                    
                    图表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../annotations/">
            
                <a href="../annotations/">
            
                    
                    注解概览
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../annotations/1study.html">
            
                <a href="../annotations/1study.html">
            
                    
                    指标注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../annotations/2plot.html">
            
                <a href="../annotations/2plot.html">
            
                    
                    绘图注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../annotations/3input.html">
            
                <a href="../annotations/3input.html">
            
                    
                    脚本输入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../annotations/4price.html">
            
                <a href="../annotations/4price.html">
            
                    
                    价格水平，hline
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../annotations/5fill.html">
            
                <a href="../annotations/5fill.html">
            
                    
                    用 fill 填充背景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../annotations/6barcolor.html">
            
                <a href="../annotations/6barcolor.html">
            
                    
                    使用 barcolor 为 series 着色
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../annotations/7bg.html">
            
                <a href="../annotations/7bg.html">
            
                    
                    使用 bgcolor 进行背景着色
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../annotations/8shape.html">
            
                <a href="../annotations/8shape.html">
            
                    
                    绘制形状、字符和箭头
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../annotations/9custom.html">
            
                <a href="../annotations/9custom.html">
            
                    
                    定制 OHLC 柱和蜡烛
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../debugging/">
            
                <a href="../debugging/">
            
                    
                    调试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../debugging/1introduction.html">
            
                <a href="../debugging/1introduction.html">
            
                    
                    指标注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../debugging/2land.html">
            
                <a href="../debugging/2land.html">
            
                    
                    功能位置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../debugging/3num.html">
            
                <a href="../debugging/3num.html">
            
                    
                    显示数值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../debugging/4str.html">
            
                <a href="../debugging/4str.html">
            
                    
                    显示字符串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../debugging/5conditions.html">
            
                <a href="../debugging/5conditions.html">
            
                    
                    调试条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../debugging/6fn.html">
            
                <a href="../debugging/6fn.html">
            
                    
                    从内部函数调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../debugging/7for.html">
            
                <a href="../debugging/7for.html">
            
                    
                    从“for”循环内部调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../debugging/8tips.html">
            
                <a href="../debugging/8tips.html">
            
                    
                    提示
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../publishing/">
            
                <a href="../publishing/">
            
                    
                    发布脚本
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../publishing/1pvp.html">
            
                <a href="../publishing/1pvp.html">
            
                    
                    公共脚本与私有脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../publishing/2mode.html">
            
                <a href="../publishing/2mode.html">
            
                    
                    发布模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../publishing/3ps.html">
            
                <a href="../publishing/3ps.html">
            
                    
                    如何发布脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../publishing/4us.html">
            
                <a href="../publishing/4us.html">
            
                    
                    如何更新脚本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../library/">
            
                <a href="../library/">
            
                    
                    公共库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../library/1description.html">
            
                <a href="../library/1description.html">
            
                    
                    描述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../library/2copy.html">
            
                <a href="../library/2copy.html">
            
                    
                    将脚本从公共库复制到您的个人库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../library/3editing.html">
            
                <a href="../library/3editing.html">
            
                    
                    编辑来自公共库的脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../library/4searching.html">
            
                <a href="../library/4searching.html">
            
                    
                    搜索脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../library/5video.html">
            
                <a href="../library/5video.html">
            
                    
                    教学视频
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../appendix/">
            
                <a href="../appendix/">
            
                    
                    附录
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../appendix/1migration.html">
            
                <a href="../appendix/1migration.html">
            
                    
                    Pine 第 3 版迁移指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../appendix/2how.html">
            
                <a href="../appendix/2how.html">
            
                    
                    操作指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../appendix/3err.html">
            
                <a href="../appendix/3err.html">
            
                    
                    Pine 的编译和执行错误
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../more/">
            
                <a href="../more/">
            
                    
                    我可以从哪里获得更多信息？
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本書使用 GitBook 釋出
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >上下文切换和 security 函数</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x4E0A;&#x4E0B;&#x6587;&#x5207;&#x6362;&#x548C;-security-&#x51FD;&#x6570;">&#x4E0A;&#x4E0B;&#x6587;&#x5207;&#x6362;&#x548C; security &#x51FD;&#x6570;</h1>
<hr>
<p>security &#x51FD;&#x6570;&#x4F7F;&#x811A;&#x672C;&#x80FD;&#x591F;&#x4ECE;&#x5176;&#x5B83;&#x4EA4;&#x6613;&#x5BF9;&#x4E2D;&#x8BF7;&#x6C42;&#x6570;&#x636E;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x811A;&#x672C;&#x6B63;&#x5728;&#x8FD0;&#x884C;&#x7684;&#x4EA4;&#x6613;&#x5BF9;&#x3002;</p>
<p>&#x8BA9;&#x6211;&#x4EEC;&#x5047;&#x8BBE;&#x4EE5;&#x4E0B;&#x811A;&#x672C;&#x5728; IBM &#x56FE;&#x8868;&#x4E0A;&#x8FD0;&#x884C;1 &#x5206;&#x949F;&#x3002;&#x5B83;&#x5C06;&#x663E;&#x793A; IBM &#x4EA4;&#x6613;&#x5BF9;&#x7684;&#x6536;&#x76D8;&#x4EF7;&#xFF0C;&#x7EA7;&#x522B;&#x4E3A; 15 &#x5206;&#x949F;&#x3002;</p>
<pre><code>//@version=4
study(&quot;Example security 1&quot;, overlay=true)
ibm_15 = security(&quot;NYSE:IBM&quot;, &quot;15&quot;, close)
plot(ibm_15)
</code></pre><p><img src="../img/35ctx/Chart_security_1.png" alt="&#x793A;&#x4F8B;&#x56FE;"></p>
<p>security &#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x6240;&#x8981;&#x6C42;&#x7684;&#x4EA4;&#x6613;&#x5BF9;&#x540D;&#x79F0;&#x3002;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x6240;&#x9700;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#xFF0C;&#x7B2C;&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x5B83;&#x5C06;&#x5728; security &#x8C03;&#x7528;&#x4E2D;&#x5BF9;&#x6240;&#x8BF7;&#x6C42;&#x7684; series &#x8FDB;&#x884C;&#x8BA1;&#x7B97;&#x3002;</p>
<p>&#x4EA4;&#x6613;&#x5BF9;&#x7684;&#x540D;&#x79F0;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E24;&#x79CD;&#x53D8;&#x4F53;&#x6765;&#x5B9A;&#x4E49;&#xFF1A;&#x5E26;&#x6709;&#x5305;&#x542B;&#x4EA4;&#x6613;&#x6240;&#xFF08;&#x6216;&#x6570;&#x636E;&#x63D0;&#x4F9B;&#x8005;&#xFF09;&#x7684;&#x524D;&#x7F00;&#xFF0C;&#x6216;&#x6CA1;&#x6709;&#x524D;&#x7F00;&#x3002;&#x4F8B;&#x5982;&#x3002;&quot;NYSE: IBM&quot;&#x3001;&quot;BATS: IBM&quot;&#x6216;&quot;IBM&quot;&#x3002;&#x5F53;&#x6CA1;&#x6709;&#x63D0;&#x4F9B;&#x4EA4;&#x6613;&#x6240;&#x65F6;&#xFF0C;BATS &#x5C06;&#x88AB;&#x4F5C;&#x4E3A;&#x9ED8;&#x8BA4;&#x503C;&#x4F7F;&#x7528;&#x3002;syminfo.ticker &#x4E0D;&#x542B;&#x4EA4;&#x6613;&#x6240;&#x524D;&#x7F00;&#x7684;&#x7B26;&#x53F7;&#x540D;&#x79F0;&#x503C;&#xFF0C;&#x4F8B;&#x5982;&quot;MSFT&quot;&#x3002; syminfo.tickerid &#x5305;&#x542B;&#x542B;&#x4EA4;&#x6613;&#x6240;&#x524D;&#x7F00;&#x7684;&#x7B26;&#x53F7;&#x540D;&#x79F0;&#x503C;&#xFF0C;&#x4F8B;&#x5982;&quot;BATS: MSFT&quot;&#x6216; &quot;NASDAQ: MSFT&quot;&#x3002;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528; syminfo.tickerid&#xFF0C;&#x4EE5;&#x907F;&#x514D; security &#x8FD4;&#x56DE;&#x7684;&#x503C;&#x51FA;&#x73B0;&#x6B67;&#x4E49;&#x3002;</p>
<p>security &#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;resolution&#xFF08;&#x5373;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#xFF09;&#xFF0C;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x3002;&#x6240;&#x6709;&#x65E5;&#x5185;&#x7EA7;&#x522B;&#x90FD;&#x662F;&#x7528;&#x5206;&#x949F;&#x6570;&#x6765;&#x5B9A;&#x4E49;&#x7684;&#x3002;&#x6700;&#x4F4E;&#x7684;&#x5206;&#x8FA8;&#x7387;&#x662F;&#x4E00;&#x5206;&#x949F;&#xFF0C;&#x7528;&#x5B57;&#x9762;&#x610F;&#x601D;&quot;1&quot;&#x8868;&#x793A;&#x3002;&#x53EF;&#x4EE5;&#x8981;&#x6C42;&#x4EFB;&#x4F55;[1]&#x5206;&#x949F;&#x6570;&#x3002;&quot;5&quot;&#xFF0C;&quot;10&quot;&#xFF0C;&quot;21&quot;&#xFF0C;&#x7B49;&#x7B49;&#x3002;&#x6BCF;&#x5C0F;&#x65F6;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x4E5F;&#x662F;&#x7531;&#x5206;&#x949F;[2]&#x8BBE;&#x5B9A;&#x7684;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x4EE5;&#x4E0B;&#x51E0;&#x884C;&#x5206;&#x522B;&#x8868;&#x793A; 1 &#x5C0F;&#x65F6;&#x3001;2 &#x5C0F;&#x65F6;&#x548C; 4 &#x5C0F;&#x65F6;&#x3002;&quot;60&quot;, &quot;120&quot;, &quot;240&quot;. &#x503C;&#x4E3A; 1 &#x5929;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x7528; &quot;D&quot;&#x6216;&quot;1D&quot;&#x8868;&#x793A;&#x3002;&#x53EF;&#x4EE5;&#x8981;&#x6C42;&#x4EFB;&#x4F55;&#x5929;&#x6570;&#x3002;&quot;2D&quot;&#x3001;&quot;3D&quot;&#xFF0C;&#x7B49;&#x7B49;&#x3002;&#x6BCF;&#x5468;&#x548C;&#x6BCF;&#x6708;&#x7684;&#x5206;&#x8FA8;&#x7387;&#x4EE5;&#x7C7B;&#x4F3C;&#x7684;&#x65B9;&#x5F0F;&#x8BBE;&#x7F6E;&#x3002;&quot;w&quot;&#x3001;&quot;1w&quot;&#x3001;&quot;2w&quot;&#x3001;...&#x3001;&quot;m&quot;&#x3001;&quot;1m&quot;&#x3001;&quot;2m&quot;&#x3002;&quot;M&quot;&#x548C;&quot;1M&quot;&#x8868;&#x793A;&#x76F8;&#x540C;&#x7684;&#x6708;&#x5EA6;&#x5206;&#x8FA8;&#x7387;&#xFF0C;&#x800C;&quot;W&quot;&#x548C;&quot;1W&quot;&#x8868;&#x793A;&#x76F8;&#x540C;&#x7684;&#x5468;&#x5EA6;&#x5206;&#x8FA8;&#x7387;&#x3002;security &#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#x53EF;&#x4EE5;&#x662F;&#x4EFB;&#x4F55;&#x7B97;&#x672F;&#x8868;&#x8FBE;&#x5F0F;&#x6216;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x8C03;&#x7528;&#xFF0C;&#x5B83;&#x5C06;&#x5728;&#x6240;&#x9009; series &#x7684;&#x80CC;&#x666F;&#x4E0B;&#x8FDB;&#x884C;&#x8BA1;&#x7B97;&#x3002;&#x4E3B;&#x56FE;&#x8868;&#x4EA4;&#x6613;&#x5BF9;&#x7684;&#x5C5E;&#x6027;&#x88AB;&#x5B58;&#x50A8;&#x5728; timeframe.period &#x5185;&#x7F6E;&#x53D8;&#x91CF;&#x4E2D;&#x3002;</p>
<p>&#x901A;&#x8FC7; security &#x51FD;&#x6570;&#xFF0C;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x67E5;&#x770B; 1 &#x5206;&#x949F;&#x7684;&#x56FE;&#x8868;&#xFF0C;&#x540C;&#x65F6;&#x663E;&#x793A;&#x4EFB;&#x4F55;&#x5176;&#x4ED6;&#x7EA7;&#x522B;&#xFF08;&#x5373;&#x65E5;&#x3001;&#x5468;&#x3001;&#x6708;&#xFF09;&#x7684;SMA&#xFF08;&#x6216;&#x4EFB;&#x4F55;&#x5176;&#x4ED6;&#x8868;&#x8FBE;&#x5F0F;&#xFF09;&#x3002;</p>
<pre><code>//@version=4
study(title=&quot;High Time Frame MA&quot;, overlay=true)
src = close, len = 9
out = sma(src, len)
out1 = security(syminfo.tickerid, &apos;D&apos;, out)
plot(out1)
</code></pre><p>&#x53EF;&#x4EE5;&#x58F0;&#x660E;&#x4EE5;&#x4E0B;&#x53D8;&#x91CF;&#xFF1A;</p>
<pre><code>spread = high - low
</code></pre><p>&#x5E76;&#x5728; 1 &#x5206;&#x949F;&#x3001;15 &#x5206;&#x949F;&#x548C; 60 &#x5206;&#x949F;&#x8BA1;&#x7B97;&#xFF1A;</p>
<pre><code>spread_1 = security(tickerid, &apos;1&apos;, spread)
spread_15 = security(tickerid, &apos;15&apos;, spread)
spread_60 = security(tickerid, &apos;60&apos;, spread)
</code></pre><p>security &#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; series&#xFF0C;&#x7136;&#x540E;&#x6839;&#x636E;&#x5F53;&#x524D;&#x56FE;&#x8868;&#x7684;&#x4EA4;&#x6613;&#x5BF9;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x8FDB;&#x884C;&#x8C03;&#x6574;&#x3002;&#x8FD9;&#x4E2A;&#x7ED3;&#x679C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x663E;&#x793A;&#x5728;&#x56FE;&#x8868;&#x4E0A;&#xFF08;&#x5373;&#x7528;&#x7ED8;&#x56FE;&#xFF09;&#xFF0C;&#x6216;&#x7528;&#x4E8E;&#x8FDB;&#x4E00;&#x6B65;&#x7684;&#x8BA1;&#x7B97;&#x3002;&quot;Advance Decline Ratio (&#x524D;&#x8FDB;&#x4E0B;&#x964D;&#x6BD4;&#x7387;) &quot;&#x811A;&#x672C;&#x8BF4;&#x660E;&#x4E86;&#x5BF9; security &#x51FD;&#x6570;&#x7684;&#x66F4;&#x591A;&#x4F7F;&#x7528;&#xFF1A;</p>
<pre><code>//@version=4
study(title = &quot;Advance Decline Ratio&quot;, shorttitle=&quot;ADR&quot;)
ratio(t1, t2, source) =&gt;
    s1 = security(t1, timeframe.period, source)
    s2 = security(t2, timeframe.period, source)
    s1 / s2
plot(ratio(&quot;USI:ADVN.NY&quot;, &quot;USI:DECL.NY&quot;, close))
</code></pre><p>&#x8BE5;&#x811A;&#x672C;&#x8981;&#x6C42;&#x589E;&#x52A0;&#x4E24;&#x4E2A;&#x4EA4;&#x6613;&#x5BF9;&#x3002;&#x7136;&#x540E;&#xFF0C;&#x8BF7;&#x6C42;&#x7684;&#x7ED3;&#x679C;&#x88AB;&#x7528;&#x4E8E;&#x4E00;&#x4E2A;&#x7B97;&#x672F;&#x516C;&#x5F0F;&#x3002;&#x7ED3;&#x679C;&#xFF0C;&#x6211;&#x4EEC;&#x6709;&#x4E00;&#x4E2A;&#x80A1;&#x5E02;&#x6307;&#x6807;&#xFF0C;&#x88AB;&#x6295;&#x8D44;&#x8005;&#x7528;&#x6765;&#x8861;&#x91CF;&#x53C2;&#x4E0E;&#x4E0A;&#x5347;&#x6216;&#x4E0B;&#x964D;&#x8D8B;&#x52BF;&#x7684;&#x4E2A;&#x522B;&#x80A1;&#x7968;&#x7684;&#x6570;&#x91CF;&#x3002;</p>
<h2 id="barmerge-&#x95F4;&#x9699;&#x548C;&#x9884;&#x8BFB;">Barmerge &#x95F4;&#x9699;&#x548C;&#x9884;&#x8BFB;</h2>
<p>&#x6709;&#x4E24;&#x4E2A;&#x5F00;&#x5173;&#x5B9A;&#x4E49;&#x4E86;&#x8BF7;&#x6C42;&#x7684;&#x6570;&#x636E;&#x5982;&#x4F55;&#x7528; security &#x51FD;&#x6570;&#x6620;&#x5C04;&#x5230;&#x5F53;&#x524D;&#x65F6;&#x95F4;&#x8303;&#x56F4;&#x3002;</p>
<p>&#x7B2C;&#x4E00;&#x4E2A;&#x5F00;&#x5173;&#xFF0C;gaps&#xFF0C;&#x63A7;&#x5236;&#x6570;&#x636E;&#x7684;&#x95F4;&#x9699;&#x3002;&#x5728;&#x9ED8;&#x8BA4;&#x503C; barmerge.gaps_off &#x4E0B;&#xFF0C;&#x6570;&#x636E;&#x88AB;&#x8FDE;&#x7EED;&#x5408;&#x5E76;&#xFF08;&#x6CA1;&#x6709; na &#x95F4;&#x9699;&#xFF09;&#x3002;&#x6240;&#x6709;&#x7684;&#x95F4;&#x9699;&#xFF08;&#x5982;&#x679C;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x90FD;&#x7528;&#x4E4B;&#x524D;&#x6700;&#x63A5;&#x8FD1;&#x7684;&#x975E; na &#x503C;&#x6765;&#x586B;&#x5145;&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528; barmerge.gaps_on&#xFF0C;&#x90A3;&#x4E48;&#x5408;&#x5E76;&#x7684;&#x6570;&#x636E;&#x53EF;&#x80FD;&#x5305;&#x542B; na &#x503C;&#x5F62;&#x5F0F;&#x7684;&#x95F4;&#x9699;&#x3002;</p>
<p>&#x7B2C;&#x4E8C;&#x4E2A;&#x5F00;&#x5173;&#xFF0C;lookahead&#xFF0C;&#x662F;&#x5728; Pine Script &#x7B2C;&#x4E09;&#x7248;&#x4E2D;&#x6DFB;&#x52A0;&#x7684;&#x3002;&#x8BE5;&#x53C2;&#x6570;&#x6709;&#x4E24;&#x4E2A;&#x53EF;&#x80FD;&#x7684;&#x503C;&#xFF1A;barmerge.lookahead_off &#x548C; barmerge.lookahead_on&#xFF0C;&#x5206;&#x522B;&#x5728; security &#x7684;&#x65B0;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;&#x548C; Pine v1 &#x548C; v2 &#x7684;&#x65E7;&#x884C;&#x4E3A;&#x4E4B;&#x95F4;&#x5207;&#x6362;</p>
<p>&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x663E;&#x793A;&#x4E86; 5 &#x5206;&#x949F;&#x56FE;&#x8868;&#x4E0A;&#x7684;&#x533A;&#x522B;&#xFF1A;</p>
<pre><code>//@version=4
study(&apos;My Script&apos;, overlay=true)
a = security(syminfo.tickerid, &apos;60&apos;, low, lookahead=barmerge.lookahead_off)
plot(a, color=color.red)
b = security(syminfo.tickerid, &apos;60&apos;, low, lookahead=barmerge.lookahead_on)
plot(b, color=color.lime)
</code></pre><p><img src="../img/35ctx/V31.png" alt="&#x793A;&#x4F8B;&#x56FE;"></p>
<p>&#x56FE;&#x8868;&#x4E0A;&#x7684;&#x7EFF;&#x7EBF;&#x662F;&#x4E00;&#x4E2A;&#x5C0F;&#x65F6;&#x67F1;&#x56FE;&#x7684;&#x4F4E;&#x4EF7;&#xFF0C;&#x8BE5;&#x67F1;&#x56FE;&#x7684;&#x8BF7;&#x6C42;&#x662F;&#x5F00;&#x7740; lookahead &#x7684;&#x3002;&#x8FD9;&#x662F; security &#x51FD;&#x6570;&#x7684;&#x65E7;&#x884C;&#x4E3A;&#x3002;&#x57FA;&#x4E8E;&#x5386;&#x53F2;&#x6570;&#x636E;&#x7684;&#x7EFF;&#x7EBF;&#x662F;&#x5728;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5C0F;&#x65F6;&#x67F1;&#x56FE;&#x521B;&#x5EFA;&#x540E;&#x9A6C;&#x4E0A;&#x663E;&#x793A;&#x7684;&#x5C0F;&#x65F6;&#x4F4E;&#x70B9;&#x7684;&#x4EF7;&#x683C;&#x6C34;&#x5E73;&#xFF08;&#x84DD;&#x8272;&#x5782;&#x76F4;&#x865A;&#x7EBF;&#xFF09;&#x3002;</p>
<p>&#x7EA2;&#x7EBF;&#x662F;&#x5728;&#x5173;&#x95ED; lookahead &#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x8BF7;&#x6C42;&#x7684;&#x5C0F;&#x65F6;&#x7EBF;&#x7684;&#x4F4E;&#x4EF7;&#x3002;&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x8981;&#x6C42;&#x7684;&#x5C0F;&#x65F6;&#x5386;&#x53F2;&#x67F1;&#x7684;&#x4F4E;&#x4EF7;&#x5C06;&#x53EA;&#x5728;&#x8981;&#x6C42;&#x7684;&#x5C0F;&#x65F6;&#x7684;&#x6700;&#x540E;&#x4E00;&#x5206;&#x949F;&#x67F1;&#x4E0A;&#x7ED9;&#x51FA;&#xFF0C;&#x6B64;&#x65F6;&#x5C0F;&#x65F6;&#x67F1;&#x7684;&#x4F4E;&#x4EF7;&#x4E0D;&#x4F1A;&#x8FD4;&#x56DE;&#x672A;&#x6765;&#x6570;&#x636E;&#x3002;</p>
<p>&#x7D2B;&#x7EA2;&#x8272;&#x7684;&#x865A;&#x7EBF;&#x4EE3;&#x8868;&#x5B9E;&#x65F6;&#x6570;&#x636E;&#x7684;&#x5F00;&#x59CB;&#x3002;&#x4F60;&#x53EF;&#x4EE5;&#x770B;&#x5230; barmerge.lookahead_on &#x548C; barmerge.lookahead_off &#x5728;&#x5B9E;&#x65F6;&#x6570;&#x636E;&#x4E0A;&#x7684;&#x884C;&#x4E3A;&#x662F;&#x4E00;&#x6837;&#x7684;&#xFF0C;&#x5373;&#x548C; barmerge.lookahead_off &#x7684;&#x884C;&#x4E3A;&#x4E00;&#x6837;&#x3002;</p>
<h2 id="&#x7406;&#x89E3;&#x9884;&#x8BFB;">&#x7406;&#x89E3;&#x9884;&#x8BFB;</h2>
<p>&#x6709;&#x8BB8;&#x591A;&#x516C;&#x5171;&#x7684;&#x811A;&#x672C;&#x4F7F;&#x7528;&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>//@version=2
//...
a = security(tickerid, &apos;D&apos;, close[1]) // It&apos;s barmerge.lookahead_on, because version is 2
</code></pre><p>&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;close[1] &#x8868;&#x8FBE;&#x5F0F;&#x83B7;&#x53D6; close &#x524D;&#x4E00;&#x5929;&#x7684;&#x503C;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x4E2A;&#x7ED3;&#x6784;&#x5E76;&#x6CA1;&#x6709;&#x4F7F;&#x7528;&#x672A;&#x6765;&#x7684;&#x6570;&#x636E;&#x3002;</p>
<p>&#x5728; Pine v3 &#x6216;&#x66F4;&#x9AD8;&#x7248;&#x672C;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7528;&#x4E24;&#x79CD;&#x4E0D;&#x540C;&#x7684;&#x65B9;&#x5F0F;&#x91CD;&#x5199;&#x5B83;&#xFF0C;&#x4F7F;&#x7528; barmerge.lookahead_on &#x6216; barmerge.lookahead_off&#x3002;&#x5982;&#x679C;&#x4F60;&#x4F7F;&#x7528; barmerge.lookahead_on&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x5F88;&#x7B80;&#x5355;&#x4E86;&#xFF1A;</p>
<pre><code>//@version=4
//...
a = security(syminfo.tickerid, &apos;D&apos;, close[1], lookahead=barmerge.lookahead_on)
</code></pre><p>&#x56E0;&#x4E3A;&#x539F;&#x6765;&#x7684;&#x6784;&#x9020;&#x6CA1;&#x6709;&#x4F7F;&#x7528;&#x672A;&#x6765;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x6240;&#x4EE5;&#x53EF;&#x4EE5;&#x7528; barmerge.lookahead_off &#x6765;&#x91CD;&#x5199;&#x5B83;&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528; barmerge.lookahead_off&#xFF0C;&#x811A;&#x672C;&#x4F1A;&#x66F4;&#x590D;&#x6742;&#xFF0C;&#x4F46;&#x663E;&#x793A;&#x4E86; lookahead &#x53C2;&#x6570;&#x7684;&#x4F5C;&#x7528;&#x3002;</p>
<pre><code>//@version=4
//...
indexHighTF = barstate.isrealtime ? 1 : 0
indexCurrTF = barstate.isrealtime ? 0 : 1
a0 = security(syminfo.tickerid, &apos;D&apos;, close[indexHighTF], lookahead=barmerge.lookahead_off)
a = a0[indexCurrTF]
</code></pre><p>&#x5F53;&#x4E00;&#x4E2A;&#x6307;&#x6807;&#x662F;&#x57FA;&#x4E8E;&#x5386;&#x53F2;&#x6570;&#x636E;&#xFF08;&#x5373; barstate.isrealtime &#x4E3A; false&#xFF09;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x91C7;&#x7528;&#x65E5;&#x7EA7;&#x522B;&#x7684;&#x5F53;&#x524D;&#x6536;&#x76D8;&#x4EF7;&#xFF0C;&#x5E76;&#x5C06; security &#x51FD;&#x6570;&#x8C03;&#x7528;&#x7684;&#x7ED3;&#x679C;&#x5728;&#x5F53;&#x524D;&#x7EA7;&#x522B;&#x4E2D;&#x5411;&#x53F3;&#x79FB;&#x52A8;&#x4E00;&#x4E2A;&#x67F1;&#x3002;&#x5F53;&#x6839;&#x636E;&#x5B9E;&#x65F6;&#x6570;&#x636E;&#x8BA1;&#x7B97;&#x6307;&#x6807;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x5728;&#x4E0D;&#x79FB;&#x52A8; security &#x6570;&#x636E;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x53D6;&#x524D;&#x4E00;&#x5929;&#x7684;&#x6536;&#x76D8;&#x4EF7;&#x3002;</p>
<h2 id="&#x8BF7;&#x6C42;&#x66F4;&#x4F4E;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x7684;&#x6570;&#x636E;">&#x8BF7;&#x6C42;&#x66F4;&#x4F4E;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x7684;&#x6570;&#x636E;</h2>
<p>security &#x51FD;&#x6570;&#x88AB;&#x8BBE;&#x8BA1;&#x7528;&#x6765;&#x8BF7;&#x6C42;&#x6BD4;&#x5F53;&#x524D;&#x56FE;&#x8868;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x66F4;&#x9AD8;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x7684;&#x6570;&#x636E;&#x3002;&#x5728;&#x4E00;&#x4E2A; 60 &#x5206;&#x949F;&#x7684;&#x56FE;&#x8868;&#x4E0A;&#xFF0C;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x8BF7;&#x6C42;240&#x3001;D&#x3001;W &#x6216;&#x4EFB;&#x4F55;&#x66F4;&#x9AD8;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x3002;</p>
<p>&#x4E0D;&#x5EFA;&#x8BAE;&#x8BF7;&#x6C42;&#x6BD4;&#x5F53;&#x524D;&#x56FE;&#x8868;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x66F4;&#x4F4E;&#x7684;&#x65F6;&#x95F4;&#x7EA7;&#x522B;&#x6570;&#x636E;&#xFF0C;&#x4F8B;&#x5982; 5 &#x5206;&#x949F;&#x56FE;&#x8868;&#x4E2D;&#x8BF7;&#x6C42; 1 &#x5206;&#x949F;&#x6570;&#x636E;&#x3002;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x7684;&#x4E3B;&#x8981;&#x95EE;&#x9898;&#x662F;&#xFF0C;1&#x5206;&#x949F;&#x6570;&#x636E;&#x7684;&#x67D0;&#x4E9B;&#x90E8;&#x5206;&#x5C06;&#x4E0D;&#x53EF;&#x907F;&#x514D;&#x5730;&#x4E22;&#x5931;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4E0D;&#x53EF;&#x80FD;&#x5728; 5 &#x5206;&#x949F;&#x56FE;&#x8868;&#x4E0A;&#x663E;&#x793A;&#x800C;&#x4E0D;&#x7834;&#x574F;&#x65F6;&#x95F4;&#x8F74;&#x3002;&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5B89;&#x5168;&#x7684;&#x884C;&#x4E3A;&#x53EF;&#x80FD;&#x662F;&#x76F8;&#x5F53;&#x610F;&#x5916;&#x7684;&#x3002;&#x4E0B;&#x4E00;&#x4E2A;&#x4F8B;&#x5B50;&#x8BF4;&#x660E;&#x4E86;&#x8FD9;&#x4E00;&#x70B9;&#xFF1A;</p>
<pre><code>// Add this script on a &quot;5&quot; minute chart
//@version=4
study(&quot;Lookahead On/Off&quot;, overlay=true, precision=5)
l_on = security(syminfo.tickerid, &quot;1&quot;, close, lookahead=barmerge.lookahead_on)
l_off = security(syminfo.tickerid, &quot;1&quot;, close, lookahead=barmerge.lookahead_off)
plot(l_on, color=color.red)
plot(l_off, color=color.blue)
</code></pre><p><img src="../img/35ctx/SecurityLowerTF_LookaheadOnOff.png" alt="&#x793A;&#x4F8B;&#x56FE;"></p>
<p>&#x8FD9;&#x9879;&#x6307;&#x6807;&#x7ED8;&#x5236;&#x4E86;&#x4E24;&#x6761;&#x7EBF;&#xFF0C;&#x5206;&#x522B;&#x5BF9;&#x5E94;&#x4E8E; lookahead &#x53C2;&#x6570;&#x7684;&#x4E0D;&#x540C;&#x503C;&#x3002;&#x7EA2;&#x7EBF;&#x663E;&#x793A;&#x7684;&#x662F;lookahead = barmerge.lookahead_on &#x65F6;&#xFF0C;security &#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x7684;&#x6570;&#x636E;&#x3002;&#x84DD;&#x7EBF;&#x662F; lookahead = barmerge.lookahead_off&#x3002;&#x8BA9;&#x6211;&#x4EEC;&#x770B;&#x4E00;&#x4E0B;&#x4ECE; 07:50 &#x5F00;&#x59CB;&#x7684; 5 &#x5206;&#x949F;&#x67F1;&#x56FE;&#x3002;&#x8BE5;&#x6761;&#x7EA2;&#x7EBF;&#x7684;&#x6570;&#x503C;&#x4E3A; 1.13151&#xFF0C;&#x5BF9;&#x5E94;&#x4E8E;&#x65F6;&#x95F4;&#x8303;&#x56F4; 07:50 - 07:54 &#x7684;&#x4E94;&#x4E2A; 1 &#x5206;&#x949F;&#x6761;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#x3002;&#x53E6;&#x4E00;&#x65B9;&#x9762;&#xFF0C;&#x540C;&#x4E00;&#x6839;&#x67F1;&#x5B50;&#x4E0A;&#x7684;&#x84DD;&#x7EBF;&#x7684;&#x6570;&#x503C;&#x4E3A; 1.13121&#xFF0C;&#x5BF9;&#x5E94;&#x4E8E;&#x540C;&#x4E00;&#x65F6;&#x95F4;&#x8303;&#x56F4;&#x5185;&#x4E94;&#x6839; 1 &#x5206;&#x949F;&#x67F1;&#x5B50;&#x4E2D;&#x7684;&#x6700;&#x540E;&#x4E00;&#x6839;&#x3002;</p>
<h2 id="&#x811A;&#x6CE8;">&#x811A;&#x6CE8;</h2>
<p>[1]    &#x5B9E;&#x9645;&#x4E0A;&#x652F;&#x6301;&#x7684;&#x6700;&#x9AD8;&#x5206;&#x949F;&#x5206;&#x7EA7;&#x522B;&#x662F;&#x201C;1440&#x201D;&#xFF08;24 &#x5C0F;&#x65F6;&#x5185;&#x7684;&#x5206;&#x949F;&#x6570;&#xFF09;&#x3002;
[2]    &#x8BF7;&#x6C42;&#x6570;&#x636E;&quot;1h&quot;&#x6216;&quot;1H&quot;&#x89E3;&#x6790;&#x5C06;&#x5BFC;&#x81F4;&#x9519;&#x8BEF;&#x3002;&#x4F7F;&#x7528;&quot;60&quot;&#x6765;&#x4EE3;&#x66FF;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="4color.html" class="navigation navigation-prev " aria-label="Previous page: 颜色">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="6drawing.html" class="navigation navigation-next " aria-label="Next page: 绘图">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"上下文切换和 security 函数","level":"1.5.5","depth":2,"next":{"title":"绘图","level":"1.5.6","depth":2,"path":"features/6drawing.md","ref":"./features/6drawing.md","articles":[]},"previous":{"title":"颜色","level":"1.5.4","depth":2,"path":"features/4color.md","ref":"./features/4color.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"剑客","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Pine Script 用户手册中文版","language":"zh","gitbook":"*","description":"Pine Script 文档中文翻译"},"file":{"path":"features/5context.md","mtime":"2021-06-12T05:29:04.503Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-06-14T07:42:18.199Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

